<?= $this->render('header.phtml') ?>
<div class="sectionHeader"><?= StarLng::get('entry_management'); ?></div>
<div class="sectionBody">
    <div class="tab-pane" id="stargbpane">
        <script type="text/javascript">
            tpResources = new WebFXTabPane(document.getElementById('stargbpane'));
        </script>
        <div class="tab-page" id="waiting">
            <h2 class="tab"><?= StarLng::get('waiting_for_approvement') ?></h2>
            <script type="text/javascript">
                tpResources.addTabPage(document.getElementById('waiting'));
            </script>
            <? foreach ($this->waiting as $row) { ?>
            <div class="stargb-message">
                <ul class="actionButtons" style="float: right; margin-top: 10px;">
                    <li>
                        <a href="<?= $this->link ?>&action=index&approved=<?= $row['id'] ?>">
                            <img src="media/style/MODxCarbon/images/icons/save.png" /> <?= StarLng::get('mark_accept') ?>
                        </a>
                    </li>
                    <li>
                        <a href="<?= $this->link ?>&action=index&spam=<?= $row['id'] ?>">
                            <img src="media/style/MODxCarbon/images/icons/delete.png" /> <?= StarLng::get('mark_spam') ?>
                        </a>
                    </li>
                </ul>
                <p>
                    <?= StarLng::get('author') ?>: <b><?= htmlspecialchars($row['author']) ?></b> (<a href="mailto:<?= htmlspecialchars($row['email']) ?>"><?= htmlspecialchars($row['email']) ?></a>)<br />
                    <?= StarLng::get('ip_address') ?>: <?= $row['ip'] ?> <a href="<?= $this->link ?>&action=index&ban=<?= $row['ip'] ?>" onclick="return confirm('<?= StarLng::get('ban_question') ?>')"><?= StarLng::get('ban') ?></a><br />
                    <?= StarLng::get('date') ?>: <?= $row['date'] ?>
                </p>
                <p><?= StarLng::get('message') ?>:<br /><?= nl2br(htmlspecialchars($row['message'])) ?></p>
            </div>
            <? } ?>
        </div>
        <div class="tab-page" id="approved">
            <h2 class="tab"><?= StarLng::get('approved') ?></h2>
            <script type="text/javascript">
                tpResources.addTabPage(document.getElementById('approved'));
            </script>
            <? foreach ($this->approved as $row) { ?>
            <div class="stargb-message">
                <ul class="actionButtons" style="float: right; margin-top: 10px;">
                    <li>
                        <a href="<?= $this->link ?>&action=index&spam=<?= $row['id'] ?>">
                            <img src="media/style/MODxCarbon/images/icons/delete.png" /> <?= StarLng::get('mark_spam') ?>
                        </a>
                    </li>
                </ul>
                <p>
                    <?= StarLng::get('author') ?>: <b><?= htmlspecialchars($row['author']) ?></b> (<a href="mailto:<?= htmlspecialchars($row['email']) ?>"><?= htmlspecialchars($row['email']) ?></a>)<br />
                    <?= StarLng::get('ip_address') ?>: <?= $row['ip'] ?> <a href="<?= $this->link ?>&action=index&ban=<?= $row['ip'] ?>" onclick="return confirm('<?= StarLng::get('ban_question') ?>')"><?= StarLng::get('ban') ?></a><br />
                    <?= StarLng::get('date') ?>: <?= $row['date'] ?>
                </p>
                <p><?= StarLng::get('message') ?>:<br /><?= nl2br(htmlspecialchars($row['message'])) ?></p>
            </div>
            <? } ?>
        </div>
        <div class="tab-page" id="spam">
            <h2 class="tab"><?= StarLng::get('spam') ?></h2>
            <script type="text/javascript">
                tpResources.addTabPage(document.getElementById('spam'));
            </script>
                <ul class="actionButtons" style="">
                    <li>
                        <a href="<?= $this->link ?>&action=index&trash=spam">
                            <img src="media/style/MODxCarbon/images/icons/delete.png" /> <?= StarLng::get('delete_all_spam') ?>
                        </a>
                    </li>
                </ul>
            <? foreach ($this->spam as $row) { ?>
            <div class="stargb-message">
                <ul class="actionButtons" style="float: right; margin-top: 10px;">
                    <li>
                        <a href="<?= $this->link ?>&action=index&approved=<?= $row['id'] ?>">
                            <img src="media/style/MODxCarbon/images/icons/save.png" /> <?= StarLng::get('mark_accept') ?>
                        </a>
                    </li>
                    <li>
                        <a href="<?= $this->link ?>&action=index&delete=<?= $row['id'] ?>" onclick="return confirm('<?= StarLng::get('delete_question') ?>')">
                            <img src="media/style/MODxCarbon/images/icons/delete.png" /> <?= StarLng::get('mark_delete') ?>
                        </a>
                    </li>
                </ul>
                <p>
                    <?= StarLng::get('author') ?>: <b><?= htmlspecialchars($row['author']) ?></b> (<a href="mailto:<?= htmlspecialchars($row['email']) ?>"><?= htmlspecialchars($row['email']) ?></a>)<br />
                    <?= StarLng::get('ip_address') ?>: <?= $row['ip'] ?> <a href="<?= $this->link ?>&action=index&ban=<?= $row['ip'] ?>" onclick="return confirm('<?= StarLng::get('ban_question') ?>')"><?= StarLng::get('ban') ?></a><br />
                    <?= StarLng::get('date') ?>: <?= $row['date'] ?>
                </p>
                <p><?= StarLng::get('message') ?>:<br /><?= nl2br(htmlspecialchars($row['message'])) ?></p>
            </div>
            <? } ?>
        </div>
        <div class="tab-page" id="filter">
            <h2 class="tab"><?= StarLng::get('filter') ?></h2>
            <script type="text/javascript">
                tpResources.addTabPage(document.getElementById('filter'));
            </script>
            <div class="stargb-message">
                <p>
                    <b><?= StarLng::get('global') ?></b>
                </p>
                <form action="<?= $this->link ?>" method="post">
                    <p>
                        <?= StarLng::get('language') ?>:
                        <select name="var[language]">
                            <? foreach ($this->languages as $lng) { ?>
                            <option value="<?= $lng ?>" <? if ($this->var['language']==$lng) { echo 'selected="selected"'; } ?> ><?= ucfirst($lng) ?></option>
                            <? } ?>
                        </select>
                    </p>
                    <p>
                        <?= StarLng::get('autodelete') ?>:
                        <input name="var[delete_days]" value="<?= $this->var['delete_days'] ?>" /> <?= StarLng::get('autodelete_days') ?>
                    </p>
                    <input type="submit" value="<?= StarLng::get('save') ?>" />
                </form>
                <p>
                    <b><?= StarLng::get('antispam') ?></b>
                </p>
                <form action="<?= $this->link ?>" method="post">
                    <p>
                        <?= StarLng::get('antispam_enabled') ?>:
                        <select name="var[antispam]">
                            <option value="false"><?= StarLng::get('settings_off') ?></option>
                            <option value="true" <? if ($this->var['antispam']=='true') { echo 'selected="selected"'; } ?> ><?= StarLng::get('settings_on') ?></option>
                        </select>
                    </p>
                    <p>
                        <?= StarLng::get('autoapprove_enabled') ?>:
                        <select name="var[autoapprove]">
                            <option value="false"><?= StarLng::get('settings_off') ?></option>
                            <option value="true" <? if ($this->var['autoapprove']=='true') { echo 'selected="selected"'; } ?> ><?= StarLng::get('settings_on') ?></option>
                        </select>
                    </p>
                    <p>
                        <?= StarLng::get('blocked_words') ?>:
                        <input type="text" size="50" name="var[blocked_words]" value="<?= $this->var['blocked_words'] ?>" />
                        <small><?= StarLng::get('blocked_words_help') ?></small>
                    </p>
                    <p>
                        <?= StarLng::get('blocked_emails') ?>:
                        <input type="text" size="50" name="var[blocked_emails]" value="<?= $this->var['blocked_emails'] ?>" />
                        <small><?= StarLng::get('blocked_emails_help') ?></small>
                    </p>
                    <input type="submit" value="<?= StarLng::get('save') ?>" />
                </form>
            </div>
            <div class="stargb-message">
                <p>
                    <b><?= StarLng::get('banned_ips') ?></b>
                </p>
                <form action="<?= $this->link ?>" method="post">
                    <p>
                        <select name="unban">
                            <? foreach ($this->bans as $ban) { ?>
                            <option value="<?= $ban['ip'] ?>"><?= $ban['ip'] ?></option>
                            <? } ?>
                        </select>
                        <input type="submit" value="<?= StarLng::get('unban') ?>" />
                    </p>
                </form>
            </div>
        </div>
    </div>
</div>
<?= $this->render('footer.phtml') ?>
        